Application deployment method and scheduler

ABSTRACT

An application deployment method and a scheduler are disclosed. The method includes: receiving, by a scheduler, an application deployment request sent for a first application by a cloud controller of a first cloud; after receiving the application deployment request, sending, by the scheduler, a first query message and a second query message to a cloud controller of a second cloud, and sending a second query message to a cloud controller of a third cloud; determining, by the scheduler, a target calculation unit from at least one calculation unit that is obtained by querying by using the first query message and the second query message and that has a first calculation capability; and deploying, by the scheduler, the first application to the target calculation unit.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation of International Application No.PCT/CN2013/090201, filed on Dec. 23, 2013, which claims priority toChinese Patent Application No. 201210592212.4, filed on Dec. 31, 2012,both of which are hereby incorporated by reference in their entireties.

TECHNICAL FIELD

The present invention relates to the field of communications, and inparticular, to an application deployment method and a scheduler.

BACKGROUND

In recent years, with rapid development of the Internet, cloud computingservices also develop vigorously. However, generally, a distance betweena cloud computing server and a user terminal is relatively long,resulting in a relatively large network delay and causing undesirableuser experience of some services. A layered cloud computing concept istherefore proposed, in which, a part of cloud computing is pushed to anedge closer to a user, to shorten a network delay and enhance userexperience. A new cloud computing network includes a central cloud and afront-end cloud. Similar to a conventional cloud computing server, thecentral cloud usually includes a large-scale data center and ispreferably deployed in a core city. The front-end cloud includes a smallor medium-scale data center and is preferably deployed in a small ormedium-sized city.

An architecture in which a central cloud and a front-end cloud areadopted may enhance user experience; however, because multiple cloudsappear on a network, how to select a suitable cloud to deploy anapplication for the application becomes an urgent problem to beresolved.

SUMMARY

An objective of embodiments of the present invention is to provide anapplication deployment method and a scheduler, which are used to selecta suitable cloud on a network including multiple clouds to deploy afirst application.

According to a first aspect, an application deployment method includes:

receiving, by a scheduler, an application deployment request sent for afirst application by a cloud controller of a first cloud;

after receiving the application deployment request, sending, by thescheduler, a first query message to a cloud controller of a secondcloud, where the first query message includes information about acalculation capability required for the first application, the firstquery message is used to query identifier information of a calculationunit that is in the second cloud and that has the calculationcapability, and the calculation capability required for the firstapplication is a first calculation capability;

after receiving the application deployment request, sending, by thescheduler, a second query message to a cloud controller of a thirdcloud, where the second query message includes the information about thefirst calculation capability, and the second query message is used toquery identifier information of a calculation unit that is in the thirdcloud and that has the first calculation capability;

determining, by the scheduler, a target calculation unit from at leastone calculation unit that is obtained by querying by using the firstquery message and the second query message and that has the firstcalculation capability; and

deploying, by the scheduler, the first application to the targetcalculation unit after determining that a runtime library required forthe first application is installed in the target calculation unit, wherethe scheduler is configured to manage the first cloud, the second cloud,and the third cloud.

Optionally, according to the first aspect, in a first implementationmanner of the first aspect, the deploying, by the scheduler, the firstapplication to the target calculation unit after determining that aruntime library required for the first application is installed in thetarget calculation unit includes:

sending, by the scheduler, a runtime library query message to a cloudcontroller corresponding to the target calculation unit, and queryingwhether the runtime library required for the first application isinstalled in the target calculation unit;

after determining that the runtime library is not installed in thetarget calculation unit, informing the target calculation unit toinstall the runtime library; and

after the target calculation unit completes the installation of theruntime library, deploying, by the scheduler, the first application tothe target calculation unit.

Optionally, according to the first aspect, in a second implementationmanner of the first aspect, the deploying, by the scheduler, the firstapplication to the target calculation unit after determining that aruntime library required for the first application is installed in thetarget calculation unit includes:

sending, by the scheduler, a runtime library query message to a cloudcontroller corresponding to the target calculation unit, and queryingwhether the runtime library required for the first application isinstalled in the target calculation unit; and

after determining that the runtime library is installed in the targetcalculation unit, deploying the first application to the targetcalculation unit.

Optionally, according to the first aspect, the first implementationmanner of the first aspect, or the second implementation manner of thefirst aspect, in a third implementation manner of the first aspect, theinformation about the first calculation capability includes any one ormore of a central processing unit (CPU) dominant frequency, a memorycapacity, network bandwidth information, and programming languagerunning environment information.

Optionally, according to the first aspect or any one of the first to thethird implementation manners of the first aspect, in a fourthimplementation manner of the first aspect, when the at least onecalculation unit is more than one calculation unit, the targetcalculation unit is:

a calculation unit that has a shortest distance from a user terminalrequesting the first application and that is in the more than onecalculation unit having the first calculation capability.

Optionally, according to the fourth implementation manner of the firstaspect, in a fifth implementation manner of the first aspect, thedistance includes a physical distance, a network distance, or a weightdistance.

Optionally, according to the first aspect or any one of the first to thefifth implementation manners of the first aspect, in a sixthimplementation manner of the first aspect,

the first cloud is a first central cloud, the second cloud is a firstfront-end cloud, and the third cloud is a second front-end cloud;

or,

the first cloud is a first front-end cloud, the second cloud is a firstcentral cloud, and the third cloud is a second central cloud;

or,

the first cloud is a first front-end cloud, the second cloud is a secondfront-end cloud, and the third cloud is a third front-end cloud.

According to a second aspect, a scheduler is configured to manage afirst cloud, a second cloud, and a third cloud, and the schedulerincludes:

a receiving unit, configured to receive an application deploymentrequest sent for a first application by a cloud controller of the firstcloud;

a first sending unit, configured to: after the receiving unit receivesthe application deployment request, send a first query message to acloud controller of the second cloud, where the first query messageincludes information about a calculation capability required for thefirst application, the first query message is used to query identifierinformation of a calculation unit that is in the second cloud and thathas the calculation capability, and the calculation capability requiredfor the first application is a first calculation capability;

a second sending unit, configured to: after the receiving unit receivesthe application deployment request, send a second query message to acloud controller of the third cloud, where the second query messageincludes the information about the first calculation capability, and thesecond query message is used to query identifier information of acalculation unit that is in the third cloud and that has the firstcalculation capability;

a determining unit, configured to determine a target calculation unitfrom at least one calculation unit that is obtained by querying by usingthe first query message and the second query message and that has thefirst calculation capability; and

a deploying unit, configured to: after it is determined that a runtimelibrary required for the first application is installed in the targetcalculation unit, deploy the first application to the target calculationunit.

Optionally, according to the second aspect, in a first implementationmanner of the second aspect, the deploying unit is specificallyconfigured to:

send a runtime library query message to a cloud controller correspondingto the target calculation unit, and query whether the runtime libraryrequired for the first application is installed in the targetcalculation unit;

after it is determined that the runtime library is not installed in thetarget calculation unit, inform the target calculation unit to installthe runtime library; and

after the target calculation unit completes the installation of theruntime library, deploy the first application to the target calculationunit.

Optionally, according to the second aspect, in a second implementationmanner of the second aspect, the deploying unit is specificallyconfigured to:

send a runtime library query message to a cloud controller correspondingto the target calculation unit, and query whether the runtime libraryrequired for the first application is installed in the targetcalculation unit; and

after it is determined that the runtime library is installed in thetarget calculation unit, deploy the first application to the targetcalculation unit.

Optionally, according to the second aspect, the first implementationmanner of the second aspect, or the second implementation manner of thesecond aspect, in a third implementation manner of the second aspect,the information about the first calculation capability includes any oneor more of a central processing unit (CPU) dominant frequency, a memorycapacity, network bandwidth information, and programming languagerunning environment information.

Optionally, according to the second aspect or any one of the first tothe third implementation manners of the first aspect, in a fourthimplementation manner of the second aspect, when the at least onecalculation unit is more than one calculation unit, the targetcalculation unit is:

a calculation unit that has a shortest distance from a user terminalrequesting the first application and that is in the more than onecalculation unit having the first calculation capability.

Optionally, according to the fourth implementation manner of the secondaspect, in a fifth implementation manner of the second aspect, thedistance includes a physical distance, a network distance, or a weightdistance.

Optionally, according to the second aspect or any one of the first tothe fifth implementation manners of the first aspect, in a sixthimplementation manner of the second aspect,

the first cloud is a first central cloud, the second cloud is a firstfront-end cloud, and the third cloud is a second front-end cloud;

or,

the first cloud is a first front-end cloud, the second cloud is a firstcentral cloud, and the third cloud is a second central cloud;

or,

the first cloud is a first front-end cloud, the second cloud is a secondfront-end cloud, and the third cloud is a third front-end cloud.

In the embodiments of the present invention, a scheduler firstdetermines, from a second cloud and a third cloud, a calculation unithaving a calculation capability required for a first application, thendetermines a target calculation unit from the determined calculationunit, and in a case in which a runtime library is installed in thetarget calculation unit, deploys the first application to the targetcalculation unit, to determine one suitable cloud from a networkincluding multiple clouds to deploy the first application.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram of a network according to an embodiment ofthe present invention;

FIG. 2 is a schematic diagram of an application deployment methodaccording to an embodiment of the present invention;

FIG. 3 a is a schematic diagram of a network according to an embodimentof the present invention;

FIG. 3 b is a schematic diagram of a network according to an embodimentof the present invention;

FIG. 3 c is a schematic diagram of a network according to an embodimentof the present invention;

FIG. 3 d is a schematic diagram of a network according to an embodimentof the present invention;

FIG. 4 is a schematic diagram of an application deployment methodaccording to an embodiment of the present invention;

FIG. 5 is a schematic diagram of a network including a scheduler and anALTO server according to an embodiment of the present invention;

FIG. 6 is a schematic diagram of a network including a scheduler and anALTO server according to an embodiment of the present invention;

FIG. 7 is a schematic diagram of an application deployment methodaccording to an embodiment of the present invention;

FIG. 8 is a schematic diagram of an application deployment methodaccording to an embodiment of the present invention;

FIG. 9 is a schematic diagram of a scheduler according to an embodimentof the present invention; and

FIG. 10 is a schematic diagram of a scheduler according to an embodimentof the present invention.

DETAILED DESCRIPTION

The present invention is described in detail in the following withreference to the accompanying drawings and specific embodiments.However, it should be noted that the following embodiments are onlyintended to help understand examples given for the technical solutions,rather than to limit the present invention.

An embodiment of the present invention discloses an applicationdeployment method, and this method is applicable to a network includinga central cloud and a front-end cloud.

FIG. 1 is a schematic diagram of a network including a central cloud anda front-end cloud. FIG. 1 shows three clouds, which are a first cloud, asecond cloud, and a third cloud. Each cloud includes a respective cloudcontroller and a respective calculation unit. The network shown in FIG.1 may further include one or more other clouds.

Based on the network shown in FIG. 1, as shown in FIG. 2, an applicationdeployment method includes the following content.

110. A scheduler receives an application deployment request sent for afirst application by a cloud controller of a first cloud.

120. After receiving the application deployment request, the schedulersends a first query message to a cloud controller of a second cloud,where the first query message includes information about a calculationcapability required for the first application, the first query messageis used to query identifier information of a calculation unit that is inthe second cloud and that has the calculation capability, and thecalculation capability required for the first application is a firstcalculation capability.

Optionally, the information about the first calculation capabilityincludes any one or more of a central processing unit (CPU) dominantfrequency, a memory capacity, network bandwidth information, andprogramming language running environment information.

130. After receiving the application deployment request, the schedulersends a second query message to a cloud controller of a third cloud,where the second query message includes the information about the firstcalculation capability, and the second query message is used to queryidentifier information of a calculation unit that is in the third cloudand that has the first calculation capability.

It should be noted that, 120 and 130 are independent from each other,120 may be performed before 130, or may also be performed after 130, ormay further be performed at the same time as 130.

140. The scheduler determines a target calculation unit from at leastone calculation unit that is obtained by querying by using the firstquery message and the second query message and that has the firstcalculation capability.

There may be only one calculation unit that is obtained by querying byusing the first query message and the second query message and that hasthe first calculation capability, that is, one cloud of the second cloudand the third cloud includes a unique calculation unit having the firstcalculation capability, and the other cloud does not include acalculation unit having the first calculation capability.

Certainly, the second cloud and the third cloud also may include acalculation unit having the first calculation capability each, andtherefore there may also be more than one calculation unit that isobtained by querying by the scheduler and that has the first calculationcapability.

Optionally, when only one calculation unit having the first calculationcapability is obtained by querying, the unique calculation unit is thetarget calculation unit.

Optionally, when more than one calculation unit having the firstcalculation capability is obtained by querying, the target calculationunit is: a calculation unit that has a shortest distance from a userterminal requesting the first application and that is in the more thanone calculation unit having the first calculation capability.Optionally, the distance includes a physical distance, a networkdistance, or a weight distance.

Optionally, when more than one calculation unit having the firstcalculation capability is obtained by querying, the target calculationunit may also be a calculation unit randomly selected by the schedulerfrom the calculation unit that are obtained by querying and that havethe first calculation capability.

The physical distance refers to a distance between two physical devices,which is determined according to respective physical positions of thetwo physical devices. For example, the physical positions may be inlatitude and longitude coordinates.

The network distance refers to a forward hop count between two physicaldevices or a period of time during which a packet is transmitted betweentwo physical devices.

The weight distance refers to a product of multiplying a physicaldistance by a weight coefficient, or, a product of multiplying a networkdistance by a weight coefficient.

150. After determining that a runtime library required for the firstapplication is installed in the target calculation unit, the schedulerdeploys the first application to the target calculation unit.

Optionally, 150 specifically includes: sending, by the scheduler, aruntime library query message to a cloud controller corresponding to thetarget calculation unit, and querying whether the runtime libraryrequired for the first application is installed in the targetcalculation unit.

Optionally, after it is determined that the runtime library is notinstalled in the target calculation unit, the target calculation unit isnotified of installing the runtime library.

After the target calculation unit completes the installation of theruntime library, the scheduler deploys the first application to thetarget calculation unit.

Optionally, after determining that the runtime library is installed inthe target calculation unit, the scheduler deploys the first applicationto the target calculation unit.

That the scheduler deploys the first application to the targetcalculation unit may be understood as that the scheduler itself deploysthe first application to the target calculation unit, or may also beunderstood as that the scheduler controls or manages another device, andthe another device deploys the first application to the targetcalculation unit.

Optionally, the runtime library includes rails, event machine(eventmachine), or another runtime library.

In this embodiment, the scheduler implements, through 110 to 150,management of the first cloud, the second cloud, and the third cloud. Inaddition, it is possible that the scheduler does not belong to or isindependent from the first cloud, the second cloud, and the third cloud,or the scheduler may also be integrated in the cloud controller of thefirst cloud, the cloud controller of the second cloud, or the cloudcontroller of the third cloud.

In addition, on a network including clouds, different clouds may playdifferent roles; for example, a cloud that is located in the center ofthe network may be referred to as a central cloud, and a cloud that islocated between the central cloud and a user may be referred to as afront-end cloud. The first cloud, the second cloud, and the third cloudin this embodiment may play respective roles.

For example, the first cloud is a first central cloud, the second cloudis a first front-end cloud, and the third cloud is a second front-endcloud; or, the first cloud is a first front-end cloud, the second cloudis a first central cloud, and the third cloud is a second central cloud;or, the first cloud is a first front-end cloud, the second cloud is asecond front-end cloud, and the third cloud is a third front-end cloud.

When the first cloud is a first central cloud, the second cloud is afirst front-end cloud, and the third cloud is a second front-end cloud,a brief schematic diagram of the network may be shown in FIG. 3 a;

when the network shown in FIG. 3 a further includes a third front-endcloud, a schematic diagram of the network is shown in FIG. 3 b;

when the first cloud is a first front-end cloud, the second cloud is afirst central cloud, and the third cloud is a second central cloud, abrief schematic diagram of the network is shown in FIG. 3 c; and

when the first cloud is a first front-end cloud, the second cloud is asecond front-end cloud, and the third cloud is a third front-end cloud,a brief schematic diagram of the network is shown FIG. 3 d.

As can be known from the content in this embodiment, a scheduler firstdetermines, from a second cloud and a third cloud, a calculation unithaving a calculation capability required for a first application, thendetermines a target calculation unit from the determined calculationunit, and in a case in which a runtime library is installed in thetarget calculation unit, deploys the first application in a first cloudto the target calculation unit, to determine one suitable cloud from anetwork including multiple clouds to deploy the first application.

An embodiment shown in FIG. 4 discloses an application deploymentmethod, which is applicable to the network shown in FIG. 3 b. The methodis used to deploy a first application in a front-end cloud to afront-end cloud, and specifically includes the following content.

210. A cloud controller CC1 of a first central cloud sends a firstrequest to a scheduler, to request deploying the first application inthe front-end cloud.

The first request includes information about a calculation capabilityrequired for the first application; herein, the calculation capabilityrequired for the first application may be referred to as a firstcalculation capability.

The information about the first calculation capability includes anyoneor more of a CPU dominant frequency, a memory capacity, networkbandwidth, and a programming language running environment. In a specificexample of the information about the first calculation capability inthis embodiment, the information about the first caculation capabilityincludes: the CPU dominant frequency being 1.0 GHz, the memory capacitybeing 512 MB, the network bandwidth being 100 Mbps, and the programminglanguage running environment being Ruby 1.9.

220. The scheduler sends a query message to a cloud controller EC1, acloud controller EC2, and a cloud controller EC3 separately, that is,the scheduler sends a first query message to the cloud controller EC1,sends a second query message to the cloud controller EC2, and sends athird query message to the cloud controller EC3. The cloud controllerEC1, the cloud controller EC2, and the cloud controller EC3 are a cloudcontroller of a first front-end cloud, a cloud controller of a secondfront-end cloud, and a cloud controller of a third front-end cloud,respectively. The first front-end cloud includes a calculation unit EN1,the second front-end cloud includes a calculation unit EN2, and thethird front-end cloud includes a calculation unit EN3. 220 may also beunderstood as three operations without an order.

The first query message, the second query message, and the third querymessage all include the information about the first calculationcapability. The first query message is used to query identifierinformation of a calculation unit that is in the first front-end cloudand that has the first calculation capability. The second query messageis used to query identifier information of a calculation unit that is inthe second front-end cloud and that has the first calculationcapability. The third query message is used to query identifierinformation of a calculation unit that is in the third front-end cloudand that has the first calculation capability.

230. The scheduler receives a first response message, a second responsemessage, and a third response message that are sent by the cloudcontroller EC1, the cloud controller EC2, and the cloud controller EC3,respectively.

The first response message sent by the cloud controller EC1 includesidentifier information of a calculation unit that is selected from thefirst front-end cloud by the cloud controller EC1 of the first front-endcloud and that has the first calculation capability. In this embodiment,the calculation unit that is selected from the first front-end cloud bythe cloud controller EC1 of the first front-end cloud and that has thefirst calculation capability is the EN1. Optionally, the first responsemessage further includes information about a calculation capability of acalculation unit selected by the cloud controller EC1.

Optionally, the first front-end cloud may include multiple calculationunits having the first calculation capability. The cloud controller EC1of the first front-end cloud may send information of some or all ofcalculation units having the first calculation capability to thescheduler. Therefore, one or more than one calculation unit having thefirst calculation capability may be selected from the first front-endcloud by the cloud controller EC1 of the first front-end cloud.

The second response message sent by the cloud controller EC2 includesidentifier information of a calculation unit that is selected from thesecond front-end cloud by the cloud controller EC2 of the secondfront-end cloud and that has the first calculation capability. In thisembodiment, the calculation unit that is selected from the secondfront-end cloud by the cloud controller EC2 of the second front-endcloud and that has the first calculation capability is the EN2.Optionally, the second response message further includes informationabout a calculation capability of a calculation unit selected by thecloud controller EC2.

The third response message sent by the cloud controller EC3 includesinformation used to indicate that the third front-end cloud does notinclude a calculation unit having the first calculation capability.Optionally, it is also possible that the cloud controller EC3 does notsend the third response message, and when not receiving the thirdresponse message within a preset period of time, the schedulerdetermines that the third front-end cloud does not include informationabout a calculation unit having the first calculation capability.

240. The scheduler determines a target calculation unit according to thefirst response message, the second response message, and the thirdresponse message. In this embodiment, a user terminal requesting thefirst application is a user terminal a. The target calculation unitdetermined in this embodiment is the calculation unit EN1 in the firstfront-end cloud. Optionally, the scheduler may also determine the targetcalculation unit according to the first response message and the secondresponse message and further according to that the third responsemessage is not received within the preset period of time.

Optionally, the target calculation unit is a calculation unit, that hasa shortest distance from the user terminal a and that is in at least onecalculation unit that is obtained by querying by the scheduler and thathas the calculation capability. For example, when the at least onecalculation unit that is obtained by querying by the scheduler and thathas the calculation capability includes the calculation unit EN1 in thefirst front-end cloud and the calculation unit EN2 in the secondfront-end cloud, the target calculation unit is a calculation unit, thathas the shorter distance from the user terminal a and that is in thecalculation unit EN1 and the calculation unit EN2.

The distance includes a physical distance, a network distance, or aweight distance.

The physical distance may be determined by using the following method:

acquiring latitude and longitude coordinates of the calculation unitEN1, the calculation unit EN2, and the user terminal a, respectively;

calculating a physical distance from the calculation unit EN1 to theuser terminal a and a physical distance from the calculation unit EN2 tothe user terminal a, respectively; and

comparing the foregoing two physical distances, and determining thecalculation unit corresponding to the shorter physical distance as thetarget calculation unit.

Optionally, during the calculation of the foregoing two physicaldistances, the latitude and longitude coordinates of the calculationunit EN1 may be replaced with latitude and longitude coordinates of thecloud controller EC1, and the latitude and longitude coordinates of thecalculation unit EN2 may be replaced with latitude and longitudecoordinates of the cloud controller EC2. A calculation result obtainedin this way is slightly low in precision, but is still acceptable inmost cases.

The network distance may be implemented by using various technologiessuch as the Application-Layer Traffic Optimization (Application-LayerTraffic Optimization in English, and the English abbreviation beingALTO), the General Network Protocol (General Network Protocol inEnglish, and the English abbreviation being GNP), or the InternetDistance Map Service (Internet Distance Map Service in English, and theEnglish abbreviation being IDMaps). In this embodiment, the ALTO is usedas an example for description with reference to FIG. 5.

As shown in FIG. 5, a scheduler includes an ALTO client. The ALTO clientinteracts with an ALTO server outside the scheduler by using the ALTOprotocol.

The scheduler acquires an IP address of a user terminal a, an IP addressand a cloud identifier of a first front-end cloud, and an IP address anda cloud identifier of a second front-end cloud.

The ALTO client in the scheduler sends to the ALTO server the IP addressof the user terminal a, the IP address of the first front-end cloud, andthe IP address of the second front-end cloud, to request the ALTO serverto determine a network distance from the first front-end cloud to theuser terminal a and a network distance from the second front-end cloudto the user terminal a.

The ALTO server sends to the ALTO client the determined network distancefrom the first front-end cloud to the user terminal a and the determinednetwork distance from the second front-end cloud to the user terminal a.

On a network including multiple front-end clouds, a distance from afront-end cloud to a user terminal is approximately equal to a distancefrom a calculation unit in the front-end cloud to the user terminal.Therefore, the network distance from the first front-end cloud to theuser terminal a is used to represent a network distance from thecalculation unit EN1 to the user terminal a, and the network distancefrom the second front-end cloud to the user terminal a is used torepresent a network distance from the calculation unit EN2 to the userterminal a.

The weight distance refers to a product of multiplying a physicaldistance by a weight coefficient, or, a product of multiplying a networkdistance by a weight coefficient.

On the network shown in FIG. 6, a policy cloud controller configures aweight factor k for multiple front-end clouds, respectively. Forexample, a weight factor configured for the first front-end cloud is k1,and k1 is valid for each calculation unit in the first front-end cloud;a weight factor configured for the second front-end cloud is k2, and k2is valid for each calculation unit in the second front-end cloud.

After it is determined that the ALTO server sends to the ALTO client thedetermined network distance from the calculation unit EN1 to the userterminal a and the determined network distance from the calculation unitEN2 to the user terminal a, the scheduler multiplies k1 by the networkdistance from the calculation unit EN1 to the user terminal a to obtaina weight distance from the calculation unit EN1 to the user terminal a,and the scheduler multiplies k2 by the network distance from thecalculation unit EN2 to the user terminal a to obtain a weight distancefrom the calculation unit EN2 to the user terminal a.

Step 250. The scheduler sends a fourth query message to a cloudcontroller of a front-end cloud corresponding to the target calculationunit, that is, a cloud controller 1, and queries whether a runtimelibrary required for the first application is installed in the targetcalculation unit.

Step 260. The scheduler receives a fourth response message sent by thecloud controller 1, and when the fourth response message indicates thatthe runtime library required for the first application is not installedin the calculation unit EN1, performs steps 270 to 290, or when thefourth response message indicates that the runtime library required forthe first application is installed in the calculation unit EN1, performsstep 290.

Step 270. The scheduler sends a notification message to the calculationunit EN1 to inform the calculation unit EN1 to install the runtimelibrary required for the first application.

Step 280. The scheduler receives an installation success message sent bythe calculation unit EN1.

Step 290. The scheduler deploys the first application to the calculationunit EN1.

After determining the target calculation unit, the scheduler maydownload the first application from the first central cloud. Inaddition, the first application may also be not downloaded by thescheduler from the first central cloud, and instead, is sent actively bythe first central cloud to the scheduler. For example, a first requestsent by the cloud controller of the first central cloud to the schedulercarries the first application.

An embodiment shown in FIG. 7 discloses an application deploymentmethod, which is applicable to the network shown in FIG. 3 c. The methodis used to deploy a first application in a front-end cloud to a centralcloud. The network includes a first front-end cloud, a cloud controllerEC1 is a cloud controller of the first front-end cloud; the networkfurther includes a first central cloud and a second central cloud, acloud controller CC1 is a cloud controller of the first central cloud,and a cloud controller CC2 is a cloud controller of the second centralcloud. The method specifically includes the following content.

310. The controller EC1 sends a first request to a scheduler, where thefirst request is used to deploy the first application in the firstfront-end cloud to a central cloud.

The first request includes information about a calculation capabilityrequired for the first application; herein, the calculation capabilityrequired for the first application may be referred to as a firstcalculation capability.

320. The scheduler sends a first query message and a second querymessage to the controller CC1 and the controller CC2, respectively. 320may also be understood as two operations without an order.

The first query message and the second query message both include theinformation about the first calculation capability, the first querymessage is used to query identifier information of a calculation unitthat is in the first central cloud and that has the calculationcapability, and the second query message is used to query identifierinformation of a calculation unit that is in the second central cloudand that has the calculation capability.

330. The scheduler receives a first response message and a secondresponse message that are sent by the cloud controller CC1 and the cloudcontroller CC2, respectively.

The first response message sent by the cloud controller CC1 includesidentifier information of a calculation unit that is selected from thefirst central cloud by the cloud controller CC1 and that has the firstcalculation capability. Optionally, the first response message furtherincludes information about a calculation capability of a calculationunit selected by the cloud controller CC1.

The second response message sent by the cloud controller CC2 includesidentifier information of a calculation unit that is selected from thesecond central cloud by the cloud controller CC2 and that has the firstcalculation capability. Optionally, the second response message furtherincludes information about a calculation capability of a calculationunit selected by the cloud controller CC2.

340. The scheduler determines a target calculation unit according to thefirst response message and the second response message. In thisembodiment, a user terminal requesting the first application is a userterminal a. In this embodiment, the determined target calculation unitis a calculation unit CN1 in the first central cloud.

Optionally, the target calculation unit is a calculation unit that has ashortest distance from the user terminal a and that is in at least onecalculation unit that is obtained by querying by the scheduler and thathas the calculation capability. For example, when the at least onecalculation unit that is obtained by querying by the scheduler and thathas the calculation capability includes the calculation unit CN1 in thefirst central cloud and a calculation unit CN2 in the second centralcloud, the target calculation unit is a calculation unit that has theshorter distance from the user terminal a and that is in the calculationunit CN1 and the calculation unit CN2. In this embodiment, thecalculation unit CN1 has the shorter distance from the user terminal a.The distance includes a physical distance, a network distance, or aweight distance.

350. The scheduler sends a third query message to a cloud controllercorresponding to the target calculation unit, that is, the cloudcontroller CC1, and queries whether a runtime library required for thefirst application is installed in the target calculation unit.

360. The scheduler receives a third response message sent by a cloudcontroller 2; and when the third response message indicates that theruntime library required for the first application is not installed inthe calculation unit CN1, performs 370 to 390; or when the thirdresponse message indicates that the runtime library required for thefirst application is installed in the calculation unit CN1, performs390.

370. The scheduler sends a notification message to the calculation unitCN1 to inform the calculation unit CN1 to install the runtime libraryrequired for the first application.

Step 380. The scheduler receives an installation success message sent bythe calculation unit CN1.

Step 390. The scheduler deploys the first application to the calculationunit CN1.

An embodiment shown in FIG. 8 discloses an application deploymentmethod, which is applicable to the network shown in FIG. 3 d. The methodis used to deploy a first application in a front-end cloud to anotherfront-end cloud. The network includes a first front-end cloud, a secondfront-end cloud, and a third front-end cloud, and cloud controllers ofthe three front-end clouds are a cloud controller EC1, a cloudcontroller EC2, and a cloud controller EC3, respectively. The methodspecifically includes the following content.

410. The controller EC1 sends a first request to a scheduler, where thefirst request is used to deploy the first application in the firstfront-end cloud to another front-end cloud.

The first request includes information about a calculation capabilityrequired for the first application; herein, the calculation capabilityrequired for the first application may be referred to as a firstcalculation capability.

420. The scheduler sends a first query message and a second querymessage to the controller EC2 and the controller EC3, respectively. 320may also be understood as two operations without an order.

The first query message and the second query message both include theinformation about the first calculation capability, the first querymessage is used to query identifier information of a calculation unitthat is in the second front-end cloud and that has the calculationcapability, and the second query message is used to query identifierinformation of a calculation unit that is in the third front-end cloudand that has the calculation capability.

Step 430. The scheduler receives a first response message and a secondresponse message that are sent by the cloud controller EC2 and the cloudcontroller EC3, respectively.

The first response message sent by the cloud controller EC2 includesidentifier information of a calculation unit that is selected from thesecond front-end cloud by the cloud controller EC2 and that has thefirst calculation capability. Optionally, the second response messagefurther includes information about a calculation capability of acalculation unit selected by the cloud controller EC2.

The second response message sent by the cloud controller EC3 includesidentifier information of a calculation unit that is selected from thethird front-end cloud by the cloud controller EC3 and that has the firstcalculation capability. Optionally, the third response message furtherincludes information about a calculation capability of a calculationunit selected by the cloud controller EC3.

440. The scheduler determines a target calculation unit according to thefirst response message and the second response message. In thisembodiment, a user terminal requesting the first application is a userterminal a. In this embodiment, the determined target calculation unitis a calculation unit EN2 in the second front-end cloud.

Optionally, the target calculation unit is a calculation unit that has ashortest distance from the user terminal a and that is in at least onecalculation unit that is obtained by querying by the scheduler and thathas the calculation capability. For example, when the at least onecalculation unit that is obtained by querying by the scheduler and thathas the calculation capability includes the calculation unit EN2 in thesecond front-end cloud and a calculation unit EN3 in the third front-endcloud, the target calculation unit is a calculation unit that has theshorter distance from the user terminal a and that is in the calculationunit EN2 and the calculation unit EN3. In this embodiment, the distancefrom the calculation unit EN2 to the user terminal a is shorter. Thedistance includes a physical distance, a network distance, or a weightdistance.

450. The scheduler sends a third query message to a cloud controllercorresponding to the target calculation unit, that is, the cloudcontroller EC2, and queries whether a runtime library required for thefirst application is installed in the target calculation unit.

460. The scheduler receives a third response message sent by the cloudcontroller EC2, and when the third response message indicates that theruntime library required for the first application is not installed inthe calculation unit EN2, performs 470 to 490, or when the thirdresponse message indicates that the runtime library required for thefirst application is installed in the calculation unit EN2, performs490.

470. The scheduler sends a notification message to the calculation unitEN2 to inform the calculation unit EN2 to install the runtime libraryrequired for the first application.

480. The scheduler receives an installation success message sent by thecalculation unit EN2.

490. The scheduler deploys the first application to the calculation unitEN2.

FIG. 9 shows a scheduler 60 in an embodiment of the present invention.The scheduler 60 is configured to manage a first cloud, a second cloud,and a third cloud. As shown in FIG. 9, the scheduler includes areceiving unit 61, a first sending unit 62, a second sending unit 63, adetermining unit 64, and a deploying unit 65.

The receiving unit 61 is configured to receive an application deploymentrequest sent for a first application by a cloud controller of the firstcloud.

The first sending unit 62 sends, after the receiving unit 61 receivesthe application deployment request, a first query message to a cloudcontroller of the second cloud, where the first query message includesinformation about a calculation capability required for the firstapplication, the first query message is used to query identifierinformation of a calculation unit that is in the second cloud and thathas the calculation capability, and the calculation capability requiredfor the first application is a first calculation capability.

Optionally, the information about the first calculation capabilityincludes any one or more of a central processing unit (CPU) dominantfrequency, a memory capacity, network bandwidth information, andprogramming language running environment information.

The second sending unit 63 sends, after the receiving unit 61 receivesthe application deployment request, a second query message to a cloudcontroller of the third cloud, where the second query message includesthe information about the first calculation capability, and the secondquery message is used to query identifier information of a calculationunit that is in the third cloud and that has the first calculationcapability.

It should be noted that, the first sending unit 62 and the secondsending unit 63 are independent from each other, and the operationexecuted by the first sending unit 62 may be executed before theoperation executed by the second sending unit 63, may also be executedafter the operation executed by the second sending unit 63, or mayfurther be executed at the same time as the operation executed by thesecond sending unit 63.

The determining unit 64 is configured to determine a target calculationunit from at least one calculation unit that is obtained by querying byusing the first query message and the second query message and that hasthe first calculation capability.

There may be only one or may also be more than one calculation unit thatis obtained by querying by using the first query message and the secondquery message and that has the first calculation capability.

Optionally, when only one calculation unit having the first calculationcapability is obtained by querying, the unique calculation unit is thetarget calculation unit.

Optionally, when more than one calculation unit having the firstcalculation capability is obtained by querying, the target calculationunit is: a calculation unit that has a shortest distance from a userterminal requesting the first application and that is in the more thanone calculation unit having the first calculation capability.Optionally, the distance includes a physical distance, a networkdistance, or a weight distance.

Optionally, when more than one calculation unit having the firstcalculation capability is obtained by querying, the target calculationunit may also be a calculation unit randomly selected by the schedulerfrom the calculation unit that are obtained by querying and that havethe first calculation capability.

The physical distance refers to a distance between two physical devices,which is determined according to respective physical positions of thetwo physical devices. For example, the physical positions may be inlatitude and longitude coordinates.

The network distance refers to a forward hop count between two physicaldevices or a period of time during which a packet is transmitted betweentwo physical devices.

The weight distance refers to a product of multiplying a physicaldistance by a weight coefficient, or, a product of multiplying a networkdistance by a weight coefficient.

The deploying unit 65 is configured to: after the determining unit 64determines that a runtime library required for the first application isinstalled in the target calculation unit, deploy the first applicationto the target calculation unit.

Optionally, the deploying unit 65 is specifically configured to: send aruntime library query message to a cloud controller corresponding to thetarget calculation unit, and query whether the runtime library requiredfor the first application is installed in the target calculation unit;optionally, after it is determined that the runtime library is notinstalled in the target calculation unit, inform the target calculationunit to install the runtime library; and after the target calculationunit completes the installation of the runtime library, deploy the firstapplication to the target calculation unit. Optionally, after it isdetermined that the runtime library is installed in the targetcalculation unit, the deploying unit 65 deploys the first application tothe target calculation unit.

That the deploying unit 65 deploys the first application to the targetcalculation unit may be understood as that the deploying unit 65 itselfdeploys the first application to the target calculation unit, or mayalso be understood as that the deploying unit 65 controls or managesanother device, and the another device deploys the first application tothe target calculation unit.

In addition, on a network including clouds, different clouds may playdifferent roles; for example, a cloud that is located in the center ofthe network may be referred to as a central cloud, and a cloud that islocated between the central cloud and a user may be referred to as afront-end cloud. The first cloud, the second cloud, and the third cloudin this embodiment may play respective roles.

For example, the first cloud is a first central cloud, the second cloudis a first front-end cloud, and the third cloud is a second front-endcloud; or, the first cloud is a first front-end cloud, the second cloudis a first central cloud, and the third cloud is a second central cloud;or, the first cloud is a first front-end cloud, the second cloud is asecond front-end cloud, and the third cloud is a third front-end cloud.

As can be known from the content in this embodiment, a scheduler firstdetermines, from a second cloud and a third cloud, a calculation unithaving a calculation capability required for a first application, thendetermines a target calculation unit from the determined calculationunit, and in a case in which a runtime library is installed in thetarget calculation unit, deploys the first application in a first cloudto the target calculation unit, to determine one suitable cloud from anetwork including multiple clouds to deploy the first application.

FIG. 10 shows a scheduler 70 in an embodiment of the present invention.The scheduler 70 is configured to manage a first cloud, a second cloud,and a third cloud. The scheduler 70 includes an input/output circuit(I/O circuit) 701, a processor (processor) 702, and a memory (memory)703. The memory 703 stores a program or an instruction that can beexecuted by the processor 702.

The input/output circuit 701 is configured to receive an applicationdeployment request sent for a first application by a cloud controller ofthe first cloud. After receiving the application deployment request, theinput/output circuit 701 is further configured to send a first querymessage and a second query message to a cloud controller of the secondcloud, where the first query message includes information about acalculation capability required for the first application, the firstquery message is used to query identifier information of a calculationunit that is in the second cloud and that has the calculationcapability, and the calculation capability required for the firstapplication is a first calculation capability, the second query messageincludes the information about the first calculation capability, and thesecond query message is used to query identifier information of acalculation unit that is in the third cloud and that has the firstcalculation capability.

Optionally, the information about the first calculation capabilityincludes any one or more of a central processing unit (CPU) dominantfrequency, a memory capacity, network bandwidth information, andprogramming language running environment information.

The foregoing operation executed by the input/output circuit 701 may becompleted under the control of the processor 702, or may also beaccomplished by the input/output circuit 701 under the control ofanother control circuit, for example, under a control circuit inside theinput/output circuit 701.

The processor 702 that has read the program or instruction determines atarget calculation unit from at least one calculation unit that isobtained by querying by using the first query message and the secondquery message and that has the first calculation capability.

There may be only one or may also be more than one calculation unit thatis obtained by querying by using the first query message and the secondquery message and that has the first calculation capability.

Optionally, when only one calculation unit having the first calculationcapability is obtained by querying, the unique calculation unit is thetarget calculation unit.

Optionally, when more than one calculation unit having the firstcalculation capability is obtained by querying, the target calculationunit is: a calculation unit that has a shortest distance from a userterminal requesting the first application and that is in the more thanone calculation unit having the first calculation capability.Optionally, the distance includes a physical distance, a networkdistance, or a weight distance.

Optionally, when more than one calculation unit having the firstcalculation capability is obtained by querying, the target calculationunit may also be a calculation unit randomly selected by the schedulerfrom the calculation unit that are obtained by querying and that havethe first calculation capability.

The physical distance refers to a distance between two physical devices,which is determined according to respective physical positions of thetwo physical devices. For example, the physical positions may be inlatitude and longitude coordinates.

The network distance refers to a forward hop count between two physicaldevices or a period of time during which a packet is transmitted betweentwo physical devices.

The weight distance refers to a product of multiplying a physicaldistance by a weight coefficient, or, a product of multiplying a networkdistance by a weight coefficient.

After it is determined that a runtime library required for the firstapplication is installed in the target calculation unit, the processor702 deploys the first application to the target calculation unit byusing the input/output circuit 701.

Specifically, the processor 702 sends, by using the input/output circuit701, a runtime library query message to a cloud controller correspondingto the target calculation unit, and queries whether the runtime libraryrequired for the first application is installed in the targetcalculation unit; optionally, after it is determined that the runtimelibrary is not installed in the target calculation unit, notifies thetarget calculation unit of installing the runtime library, and after thetarget calculation unit completes the installation of the runtimelibrary, deploys the first application to the target calculation unit.Optionally, after it is determined that the runtime library is installedin the target calculation unit, the processor 702 deploys the firstapplication to the target calculation unit.

In the scheduler 70, the processor 702 cooperates with the input/outputcircuit 701 according to the program or instruction to execute alloperations of the scheduler in the embodiments corresponding to FIG. 2,FIG. 4, FIG. 7, FIG. 8, and FIG. 9.

As can be known from the content in this embodiment, a scheduler firstdetermines, from a second cloud and a third cloud, a calculation unithaving a calculation capability required for a first application, thendetermines a target calculation unit from the determined calculationunit, and in a case in which a runtime library is installed in thetarget calculation unit, deploys the first application in a first cloudto the target calculation unit, to determine one suitable cloud from anetwork including multiple clouds to deploy the first application.

A person of ordinary skill in the art may understand that all or a partof the steps of the method embodiments may be implemented by a programinstructing relevant hardware. The program may be stored in a computerreadable storage medium. When the program runs, the steps of the methodembodiments are performed. The foregoing storage medium includes: anymedium that can store program code, such as a ROM, a RAM, a magneticdisk, or an optical disc.

The foregoing descriptions are merely exemplary specific implementationmanners of the present invention, but are not intended to limit theprotection scope of the present invention. Any variation or replacementreadily figured out by a person skilled in the art within the technicalscope disclosed in the present invention shall fall within theprotection scope of the present invention.

What is claimed is:
 1. An application deployment method, comprising:receiving, by a scheduler, an application deployment request sent for afirst application by a cloud controller of a first cloud; afterreceiving the application deployment request, sending, by the scheduler,a first query message to a cloud controller of a second cloud, whereinthe first query message comprises information about a calculationcapability required for the first application, the first query messageis used to query identifier information of a calculation unit that is inthe second cloud and that has the calculation capability, and thecalculation capability required for the first application is a firstcalculation capability; after receiving the application deploymentrequest, sending, by the scheduler, a second query message to a cloudcontroller of a third cloud, wherein the second query message comprisesthe information about the first calculation capability, and the secondquery message is used to query identifier information of a calculationunit that is in the third cloud and that has the first calculationcapability; determining, by the scheduler, a target calculation unitfrom at least one calculation unit that is obtained by querying by usingthe first query message and the second query message and that has thefirst calculation capability; and deploying, by the scheduler, the firstapplication to the target calculation unit after determining that aruntime library required for the first application is installed in thetarget calculation unit, wherein the scheduler is configured to managethe first cloud, the second cloud, and the third cloud.
 2. The methodaccording to claim 1, wherein deploying, by the scheduler, the firstapplication to the target calculation unit after determining that aruntime library required for the first application is installed in thetarget calculation unit comprises: sending, by the scheduler, a runtimelibrary query message to a cloud controller corresponding to the targetcalculation unit, and querying whether the runtime library required forthe first application is installed in the target calculation unit; afterdetermining that the runtime library is not installed in the targetcalculation unit, informing the target calculation unit to install theruntime library; and after the target calculation unit completes theinstallation of the runtime library, deploying, by the scheduler, thefirst application to the target calculation unit.
 3. The methodaccording to claim 1, wherein deploying, by the scheduler, the firstapplication to the target calculation unit after determining that aruntime library required for the first application is installed in thetarget calculation unit comprises: sending, by the scheduler, a runtimelibrary query message to a cloud controller corresponding to the targetcalculation unit, and querying whether the runtime library required forthe first application is installed in the target calculation unit; andafter determining that the runtime library is installed in the targetcalculation unit, deploying the first application to the targetcalculation unit.
 4. The method according to claim 1, wherein theinformation about the first calculation capability comprises any one ormore of a central processing unit (CPU) dominant frequency, a memorycapacity, network bandwidth information, and programming languagerunning environment information.
 5. The method according to claim 1,wherein when the at least one calculation unit is more than onecalculation unit, the target calculation unit comprises: a calculationunit that has a shortest distance from a user terminal requesting thefirst application and that is in the more than one calculation unithaving the first calculation capability.
 6. The method according toclaim 5, wherein the distance comprises a physical distance, a networkdistance, or a weight distance.
 7. The method according to claim 1,wherein: the first cloud is a first central cloud, the second cloud is afirst front-end cloud, and the third cloud is a second front-end cloud;or the first cloud is a first front-end cloud, the second cloud is afirst central cloud, and the third cloud is a second central cloud; orthe first cloud is a first front-end cloud, the second cloud is a secondfront-end cloud, and the third cloud is a third front-end cloud.
 8. Ascheduler for managing a first cloud, a second cloud, and a third cloud,the scheduler comprising: a receiving unit, configured to receive anapplication deployment request sent for a first application by a cloudcontroller of the first cloud; a first sending unit, configured to:after the receiving unit receives the application deployment request,send a first query message to a cloud controller of the second cloud,wherein the first query message comprises information about acalculation capability required for the first application, the firstquery message is used to query identifier information of a calculationunit that is in the second cloud and that has the calculationcapability, and the calculation capability required for the firstapplication is a first calculation capability; a second sending unit,configured to: after the receiving unit receives the applicationdeployment request, send a second query message to a cloud controller ofthe third cloud, wherein the second query message comprises theinformation about the first calculation capability, and the second querymessage is used to query identifier information of a calculation unitthat is in the third cloud and that has the first calculationcapability; a determining unit, configured to determine a targetcalculation unit from at least one calculation unit that is obtained byquerying by using the first query message and the second query messageand that has the first calculation capability; and a deploying unit,configured to: after it is determined that a runtime library requiredfor the first application is installed in the target calculation unit,deploy the first application to the target calculation unit.
 9. Thescheduler according to claim 8, wherein the deploying unit is configuredto: send a runtime library query message to a cloud controllercorresponding to the target calculation unit, and query whether theruntime library required for the first application is installed in thetarget calculation unit; after it is determined that the runtime libraryis not installed in the target calculation unit, inform the targetcalculation unit to install the runtime library; and after the targetcalculation unit completes the installation of the runtime library,deploy the first application to the target calculation unit.
 10. Thescheduler according to claim 8, wherein the deploying unit is configuredto: send a runtime library query message to a cloud controllercorresponding to the target calculation unit, and query whether theruntime library required for the first application is installed in thetarget calculation unit; and after it is determined that the runtimelibrary is installed in the target calculation unit, deploy the firstapplication to the target calculation unit.
 11. The scheduler accordingto claim 8, wherein the information about the first calculationcapability comprises any one or more of a central processing unit (CPU)dominant frequency, a memory capacity, network bandwidth information,and programming language running environment information.
 12. Thescheduler according to claim 8, wherein when the at least onecalculation unit is more than one calculation unit, the targetcalculation unit comprises: a calculation unit that has a shortestdistance from a user terminal requesting the first application and thatis in the more than one calculation unit having the first calculationcapability.
 13. The scheduler according to claim 12, wherein thedistance comprises a physical distance, a network distance, or a weightdistance.
 14. The scheduler according to claim 8, wherein: the firstcloud is a first central cloud, the second cloud is a first front-endcloud, and the third cloud is a second front-end cloud; or the firstcloud is a first front-end cloud, the second cloud is a first centralcloud, and the third cloud is a second central cloud; or the first cloudis a first front-end cloud, the second cloud is a second front-endcloud, and the third cloud is a third front-end cloud.